import { GetanButtonProps } from "@/components/Button/src/types"

/**
 * 模态框属性
 */
export interface GetanModalProps {
    /**
     * 标题头
     */
    title?: string
    /**
     * 标题头左侧图标
     */
    icon?: string
    /**
     * 宽度
     */
    width?: number
    /**
     * 是否可关闭
     */
    closable?: boolean
    /**
     * 是否显示遮罩
     */
    mask?: boolean
    /**
     * 取消按钮 @on-cancel
     */
    cancel?: false | GetanButtonProps
    /**
     * 确认按钮 @on-ok
     */
    ok?: false | GetanButtonProps
    /**
     * 按钮位置
     */
    actionPosition?: "left" | "right"
}

/**
 * @description: 弹窗对外暴露的方法
 */
export interface ModalMethods {
    init?: (props: Partial<GetanModalProps>) => void
    open: (title?: string) => void
    close: () => void
}

export type RegisterFn = (ModalInstance: ModalMethods) => void

export type UseModalReturnType = { register: RegisterFn; methods: ModalMethods }
